package com.ahcloud.edas.gatewaylog.client.exception;

import com.ahcloud.edas.common.enums.ErrorCode;
import lombok.Getter;

/**
 * @program: ahcloud-operatelog
 * @description:
 * @author: YuKai Fan
 * @create: 2024/6/6 13:35
 **/
@Getter
public enum LogRetCodeEnum implements ErrorCode {

    /**
     * 公共系统响应码
     */
    SUCCESS(0,"成功"),
    REFRESH_TOKEN_INVALID(401, "刷新令牌无效"),
    REFRESH_TOKEN_EXPIRED(401, "刷新令牌已过期，请重新登录"),

    UNKNOWN_ERROR(100_0_001,"未知错误"),
    SYSTEM_ERROR(100_0_002,"系统异常"),
    SERVER_ERROR(100_0_003,"服务出错啦，请联系管理员"),

    /**
     * 公共参数响应码
     */
    PARAM_MISS(100_1_001,"缺少必要参数[%s]"),
    PARAM_ILLEGAL(100_1_002,"参数非法"),
    PARAM_ILLEGAL_FIELD(100_1_004,"[%s]参数非法"),
    PARAM_PARSING_FIELD(100_1_005,"参数解析失败"),
    NOT_SUPPORT(100_1_006,"不支持操作"),

    TIME_PERIOD_ERROR(100_1_007, "时间段异常[%s]"),

    DATA_NOT_EXISTED(100_2_005, "数据不存在"),
    ;


    private final int code;
    private final String message;

    LogRetCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
